<?php

$curr = scandir("./");

foreach ($curr as $value){
	if ($value != "." && $value != ".." && is_dir($value)){
		$smilies[$value] = scandir($value);
	}
}

echo "<div style=\"width: 400px; margin: auto;\">";
foreach ($smilies as $key => $value){
	echo "<div style=\"display: table-cell; width: 150px;\">
	<h3>".$key."</h3>\n";
	foreach ($smilies[$key] as $smiley){
		if ($smiley != "." && $smiley != ".."){
		echo "<p><img src=\"".$key."/".$smiley."\"/><br/>".$smiley."</p>\n";
		}
	}
	echo "</div>";
}
echo "</div>";

?>